jQuery.extend(jQuery.validator.messages, {
    required: "必选字段",
    email:"请填写您的可用邮箱地址",
    rangelength: $.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"),
    equalTo:"请保证密码输入一致"
});
jQuery.validator.addMethod("stringCheck", function(value, element) {
    return this.optional(element) || /^[a-zA-Z0-9\u4e00-\u9fa5-_]+$/.test(value);
}, "只能包含中文、英文、数字、下划线等字符");

jQuery("#signupForm").validate({
    rules: {
        username: {
            required: true,
            email:true
        },
        password: {
            required: true,
            stringCheck:true,
            rangelength:[6,12]
        },
        repassword: {
            equalTo:"#password"
        }
    }
});
